<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>查看用户</title>
    <%@ include file="/easyprepay/jsp/common/head.jsp"%>
    <%@ taglib uri="/easyprepay" prefix="easy"%>
  
  </head>
  
  <body>

  <form action="<%=basePath%>user.do" method="post">
  <input type="hidden" name="method" id="method" value="queryUser"/>
  <%Object history = request.getAttribute("history");
  if(null == history){
	  history = "";
  }
  %>
   用户姓名：<input type="text" id="username" name="username" value="<%=history.toString()%>"/>
  <input type="submit" value="查询"/></form>
  
   <%
  /**当前页数*/
  String currentPageNum = request.getAttribute("currentPageNum") + "";
  /**总页数*/
  String totlePageNum = request.getAttribute("totlePageNum") + "";

  %>
  
  <table align="center" width="100%" border="1">
  <tr><td></td><td>登录账号</td><td>用户名</td><td>用户权限</td></tr>
  <%
  //获取用户集合
  List<Map<String, Object>> list = (List<Map<String, Object>>)request.getAttribute("userArray");
  //循环展示
  int i = (Integer.valueOf(currentPageNum) - 1) * 12 + 1;
  for(Map<String, Object> map:list){ 
	  String roleName = map.get("ROLE_NAME") + "";
	  roleName = "null".equals(roleName)?"未设置用户角色":roleName;
  %>
    <tr><td><%=i++%></td>
    <td><%=map.get("LOGIN_ID")%></td>
    <td><%=map.get("USER_NAME")%></td>
    <td><%=roleName%></td></tr>
  <%} %>
  </table>


  <easy:page url='<%=(basePath + "user.do?method=viewUser")%>' currentPageNum='<%=currentPageNum%>' totalPageNum='<%=totlePageNum%>'/>
  <script src="<%=basePath%>easyprepay/js/common/page.js" type="text/javascript"></script>
  </body>
</html>
